
pub fn padding(message: &[u8]) -> Vec<u8> {
    let mut padded_message = Vec::from(message);

    // 1. Add 1
    padded_message.push(0x80);

    // 2. Padd 0
    // last 8 bytes are 'length'
    // Need to padd 0 until padded_message.len() % 64 = 56
    let zero_byte_count = if padded_message.len() % 64 <= 56 {
        56 - (padded_message.len() % 64 )  
    } else {
        64 - (padded_message.len() % 64) + 56
    };

    for _ in 0..zero_byte_count {
        padded_message.push(0x00);
    }

    // 3. Append length
    let length_in_bits: u64 = (message.len() * 8) as u64;
    for byte in  length_in_bits.to_be_bytes() {
        padded_message.push(byte);
    }
    
    padded_message
} 